<template>
  <div id="list">
    <el-table
      :data="memberlist"
      style="width: 100%"
      row-key="id"
      border
      lazy
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="id" label="用户编号" width="200">
      </el-table-column>
      <el-table-column prop="nickname" label="昵称" width="200">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" width="200">
      </el-table-column>
      <el-table-column label="状态">
        <template slot-scope="scope">
          <div>
            <el-button type="success" v-if="scope.row.status == 1"
              >启用</el-button
            >
            <el-button type="danger" v-else>禁用</el-button>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <div>
            <el-button type="primary" plain @click="edit(scope.row.uid)"
              >编 辑</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { mapActions, mapGetters } from "vuex";
// import { successAlert, warningAlert } from "../../../util/alert.js";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapGetters({
      memberlist: "member/list",
    }),
  },
  methods: {
    ...mapActions({
      reqChangeMember: "member/reqChangeMember",
    }),
    edit(uid) {
      this.$emit("edit", uid);
    },
  },
  mounted() {
    this.reqChangeMember();
  },
};
</script>
<style>
</style>